public class SwapTwoNumberWithoutThirdVariable{
   public static void main(String[] args) {      
      int num1 = 20, num2 = 40;
      System.out.println ("Value of Num1 before swapping: " +num1 );
      System.out.println ("Value of Num2 before swapping: " +num2 );    
     
      num1 = num1*num2;       
      num2 = num1/num2;         
      num1 = num1/num2;          
     
      System.out.println ("Value of Num1 after swapping: " +num1 );
      System.out.println ("Value of Num2 after swapping: " +num2 );
   }
}[^1]